package com.quectel.mobile.controller.partybuilding;


import com.quectel.core.module.partybuilding.dto.PartyPersonBirthdayMsgRecordDto;
import com.quectel.core.module.partybuilding.dto.PartyPersonDto;
import com.quectel.core.module.partybuilding.service.PartyPersonBirthdayMsgRecordService;
import com.quectel.mobile.controller.BaseController;
import com.quectel.mobile.util.SessionHolder;
import com.quectel.util.common.Response;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Objects;

/**
 *
 * @author bob
 * @email bob.yu@quectel.com
 * @date 2023/05/24 11:17
 */
@RestController
@RequestMapping("partyPersonBirthdayMsgRecord")
@Tag(name = "PartyPersonBirthdayMsgRecordController", description = "政治生日推送记录相关api")
public class PartyPersonBirthdayMsgRecordController extends BaseController {

    @DubboReference
    private PartyPersonBirthdayMsgRecordService partyPersonBirthdayMsgRecordService;


    /*
     * 详情
     *
     * @param id
     * @return
     */
    @GetMapping("info/{id}")
    @Operation(summary = "根据id查询政治生日推送记录的详情")
    public Response<PartyPersonBirthdayMsgRecordDto> info(@PathVariable("id") Long id) {

        SessionHolder.checkPartyPerson();
        PartyPersonDto partyPerson = Objects.requireNonNull(SessionHolder.getLoginMobileUserSession()).getPartyPerson();

        PartyPersonBirthdayMsgRecordDto partyPersonBirthdayMsgRecordDto = partyPersonBirthdayMsgRecordService.selectById(id);

        return Response.<PartyPersonBirthdayMsgRecordDto>ok().wrap(partyPersonBirthdayMsgRecordDto);
    }

}
